﻿@model FastFood.Core.Models.OrderModel

@{
    ViewBag.PageTitle = "Order " + Model.Id;
}

<h2>Order @Model.Id</h2>

<fieldset>
    <legend>Details</legend>
    <div class="display-label">Description</div>
    <div class="display-field">@Model.Description</div>

    <div class="display-label">Cost</div>
    <div class="display-field">@String.Format("{0:F}", Model.Cost)</div>

    <div class="display-label">Date Ordered</div>
    <div class="display-field">@String.Format("{0:g}", Model.DateOrdered)</div>

    @if (Model.DateDelivered.HasValue)
    {
    <div class="display-label">Date Delivered</div>
    <div class="display-field">@String.Format("{0:g}", Model.DateDelivered)</div>
    }
    
    <div class="display-label">Status</div>
    <div class="display-field" style="font-weight:bold; color: DarkGreen">@Model.Status.ToString()</div>    
</fieldset>
<fieldset>
    <legend>Client information</legend>
    <div class="display-label">Client name</div>
    <div class="display-field">@Model.Client.FirstName @Model.Client.LastName</div>
    <div class="display-label">Client e-mail</div>
    <div class="display-field">@Model.Client.Email</div>
    <div class="display-label">Client address</div>
    <div class="display-field">@Model.Client.Address.ToString()</div>
</fieldset>
<fieldset>
    <legend>Restaurant information</legend>

    <div class="display-label">Restaurant name</div>
    <div class="display-field">@Model.DeliveryBoy.Restaurant.Name</div>

    <div class="display-label">Restaurant description</div>
    <div class="display-field">@Model.DeliveryBoy.Restaurant.Description</div>

    <div class="display-label">Restaurant address</div>
    <div class="display-field">@Model.DeliveryBoy.Restaurant.Address.ToString()</div>

    <div class="display-label">Delivery boy</div>
    <div class="display-field">@Model.DeliveryBoy.FirstName @Model.DeliveryBoy.LastName</div>
</fieldset>

<p>
    @Html.ActionLink("Back to List", "Index")
</p>

